<input type="hidden" name="inumbers" value="0">
<div class="layui-form-item" id="show-interface" style="display: none;">
    <input type="checkbox" name="set_model[relation]" lay-skin="primary" title="关联模型" lay-filter="showinterface">
</div>
<div class="layui-form-item">
    <h4>主模型设置（查询）</h4>
    <hr>
</div>
<div id="main-content">
    <div class="layui-inline flex">
        <select name="mtable" lay-verify="required" lay-search="" lay-filter="" class="layui-select">
            {volist name='apimodels' id='vo'}
            <option value="{$vo.id}">{$vo.name}</option>
            {/volist}
        </select>

        <div class="layui-input-inline flex">
            <input type="text" name="interface_where" autocomplete="off" class="layui-input" placeholder="例如where：name,title">
            <input type="text" name="interface_whereOr" autocomplete="off" class="layui-input" placeholder="例如whereOr：name,title">
            <select name="find_interface" lay-verify="required" lay-search="" lay-filter="" class="layui-select">
                <option value="find">单条</option>
                <option value="select">多条</option>
                <option value="paginate">分页</option>
            </select>
        </div>
    </div>
</div>
<div class="layui-form-item">
</div>
<div id="interface-set">
    <!-- 关联模型 -->
    <div class="layui-form-item">
        <h4>关联表设置</h4>
        <hr>
    </div>
    <div id="add-interface-temptl">
        <!-- 动态div -->
    </div>
    <div class="layui-form-item">
        <button id="add-interface-content" type="button" class="layui-btn chang-color">追加关联模型</button>
    </div>
</div>
<div class="layui-form-item">
</div>
<div id="interface-tpl" style="display: none;">
    <div class="main-content">
        <div class="layui-inline">
            <div class="layui-input-inline short">
                <h6>请选择关联表</h6>
                <select name="otable" lay-verify="required" lay-search="" lay-filter="main-table" class="layui-select other-table" disabled="disabled">
                    {volist name='tables' id='vo'}
                    <option value="{$vo}">{$vo}</option>
                    {/volist}
                </select>
            </div>
            <div class="layui-input-inline short">
                <h6>请选择关联类型</h6>
                <select name="otype" lay-verify="required" lay-search="" lay-filter="other-type" class="layui-select other-type" disabled="disabled">
                    <option value="belongsto">belongsto</option>
                    <option value="hasone">hasone</option>
                </select>
            </div>
            <div class="layui-input-inline short other-key">
                <h6>关联外键</h6>
                <select name="okey" lay-verify="required" lay-search="" lay-filter="" class="layui-select" disabled="disabled">
                </select>
            </div>
            <div class="layui-input-inline short main-key">
                <h6>关联主键</h6>
                <select name="mkey" lay-verify="required" lay-search="" lay-filter="" class="layui-select" disabled="disabled">
                </select>
            </div>
            <div class="layui-input-inline short fields-div">
                <div class="layui-form-item">
                    <h6>请选择显示字段(默认全部)</h6>
                </div>
                <input type="hidden" name="ofields" disabled="disabled">
                <div class="layui-input-inline demo xm-select-data field-data"></div>
            </div>
            <div class="layui-input-inline short">
                <button type="button" class="layui-btn chang-color layui-btn-danger del-btn interface-del-btn">移除</button>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
    </div>
</div>